This invention relates in general to the field of computer systems and software, and more particularly to a computer-based system and method for inferring a four-digit calendar year from a date expressed in a format having a two-digit calendar year.
Many application programs manipulate dates, expressed in a wide variety of formats, according to their particular operation. For example, an inventory application program might recommend an action after determining the age of an inventoried item, a banking application program might calculate interest according to one or more dates, and a health care application program might determine the availability of coverage based on one or more dates. It is often desirable during operation of application programs to convert dates expressed in a format having a two-digit calendar year to dates expressed in a format having a four-digit calendar year. However, traditional techniques that infer the first two digits of a four-digit calendar year to be xe2x80x9c19xe2x80x9d in all cases are wholly inadequate on, and after Jan. 1, 2000, leading to what has been commonly referred to as the xe2x80x9cyear 2000 problem.xe2x80x9d
As the number and complexity of application programs continue to increase, and as Jan. 1, 2000 looms nearer, techniques for converting dates expressed in a format with a two-digit calendar year to dates expressed in a format having a four-digit calendar year have become increasingly important. A known technique for converting a date in a format having a two-digit calendar year receives input from the application program specifying a ninety-nine year window surrounding the date. Since the two-digit calendar year can occur only once during any ninety-nine year window, a four-digit calendar year can be unambiguously inferred whether the first two digits of the four-digit calendar should be xe2x80x9c19xe2x80x9d or xe2x80x9c20xe2x80x9d. Although such techniques may be acceptable in some circumstances, they are often unable to correctly infer four-digit calendar years unless modifications are made to the application programs, for example, that allow the application programs to provide information specifying the ninety-nine year window. As a result, these techniques may involve increased costs and delays associated with additional programming and debugging requirements.
According to the present invention, disadvantages and problems associated with inferring a calendar year from a date expressed in a format having a two-digit year have been substantially reduced or eliminated.
According to one embodiment of the present invention, a computer-based system is provided for inferring an output date expressed in a format having a four-digit calendar year from a historical input date expressed in a format having a two-digit calendar year. The system includes a converter that receives from an application program an input date parameter corresponding to the input date and specifying a two-digit input year value. The converter also receives from an operating system a current system date recognizable to the converter in a format having a four-digit calendar year, the first two digits of which have a current century value and the last two digits of which have a current two-digit value. The converter compares the input year value with the current two-digit value and, if the input year value is less than or equal to the current two-digit value, infers the first two digits of the four-digit calendar year of the output date to be the current century value. The converter may infer the first two digits of the four-digit calendar year of the output date to be xe2x80x9c19xe2x80x9d if the input year value is not less than or equal to the current two-digit value.
The system and method of the present invention provide a number of important technical advantages. Unlike prior techniques for converting a date in a format having a two-digit calendar year, the system and method of the present invention are able to correctly infer a four-digit calendar year from a date expressed in a format having a two-digit year without requiring modifications to the application programs that need the inferred date. As a result, the present invention reduces costs and delays associated with additional programming and debugging activities that would otherwise be necessary. The present invention infers the correct four-digit calendar year regardless of whether the first two digits of the four-digit calendar year should be, for example, xe2x80x9c19xe2x80x9d or xe2x80x9c20,xe2x80x9d providing an advantageous solution to the xe2x80x9cyear 2000 problem.xe2x80x9d Other important technical advantages are readily apparent to those skilled in the art from the following figures, description, and claims.